#! /bin/bash
# desc: 发布到生产环境
# author: Thomas
# date: 2019-12-28

cd `dirname $0`

echo "构建应用"
mvn clean package -Dmaven.test.skip=true
[[ $? != 0 ]] && echo "构建失败" && exit

echo "发布到远端: em-admin"
rsync -avz em-admin/target/em-admin.jar root@romo01:/root/project/P30200/app/
ssh root@romo01 'source ~/.bashrc; docker-compose -f /root/project/P30200/docker-compose.yml restart em-admin'


#c7xnzEOw2OAUmt2